package ytt.spec.edu.week12_class01;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class ActivityFirst extends AppCompatActivity {
    private List<First> firstList=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);
        initFirst();
        FirstAdapter adapter=new FirstAdapter(ActivityFirst.this,R.layout.first_item,firstList);
        ListView ListView=(ListView)findViewById(R.id.list_view);
        ListView.setAdapter((ListAdapter) adapter);
    }
    private void initFirst(){
        First one=new First("订阅号消息",R.drawable.a,"小新说车：什么是小众的豪华，这辆车能回答");
        firstList.add(one);
        First two=new First("指云端",R.drawable.b,"这个秋冬他们相继离世，癌症是怎样摧残...");
        firstList.add(two);
        First three=new First("微信收款助手",R.drawable.c,"微信支付收款4.00元");
        firstList.add(three);
        First four=new First("金大师为民服务",R.drawable.d,"机构师说：");
        firstList.add(four);
        First five=new First("春晖花园客服服务中心",R.drawable.e,"[10条]春晖花园客服中心：@3_1_903水有");
        firstList.add(five);
        First six=new First("H161 师晨冰 涨价逻辑交流群",R.drawable.f,"Aa严师高级助理-小胡（胡文涛）：[太阳]...");
        firstList.add(five);
        First seven=new First("微信团队",R.drawable.g,"微信登录操作");
        firstList.add(seven);
        First eight=new First("幼专教职工足球协会",R.drawable.h,"");
        firstList.add(eight);

    }
}
